package com.example.ruiji.utils.vo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

/**
 * Author:BaiYiChen
 * Date:2022/4/19 21:51
 *
 * @author BaiYiChen
 */

@Data
@AllArgsConstructor
@NoArgsConstructor
public class Result {
  private Integer code;
  private Boolean success;
  private String msg;
  private Object data;
  
  public Result(Integer code, String msg, Object data) {
    this.code = code;
    this.msg = msg;
    this.data = data;
  }
  
  public static Result successful(Object data){
    return new Result(200,true,"success",data);
  }
  public static Result failed(Integer code,String msg){
    return new Result(code,false,msg,null);
  }
}
